home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-10-12 | 26.9 KB | 756 lines | [TEXT/PJMM] |
- unit AppleEvents;
-
- { Pascal Interface to the Macintosh Libraries }
-
- { Copyright © Apple Computer Inc. }
- { All Rights Reserved }
-
- { Adapted for use with THINK Pascal 4.0.x by Marco Piovanelli }
-
- interface
- uses
- Types, Notification;
-
- const
-
- { gestalt constants (!!! transplanted from GestaltEqu.p !!!) }
-
- gestaltAppleEventsAttr = 'evnt'; { Apple Events attributes }
- gestaltAppleEventsPresent = 0; { True if Apple Events present }
- gestaltScriptingSupport = 1;
- gestaltOSLInSystem = 2; { OSL is in system so don’t use the one linked in to app }
-
- { Apple event Manager error codes (!!! transplanted from Errors.p !!!) }
-
- errAECoercionFail = -1700; { bad parameter data or unable to coerce the data supplied }
- errAEDescNotFound = -1701;
- errAECorruptData = -1702;
- errAEWrongDataType = -1703;
- errAENotAEDesc = -1704;
- errAEBadListItem = -1705; { the specified list item does not exist }
- errAENewerVersion = -1706; { need newer version of the AppleEvent manager }
- errAENotAppleEvent = -1707; { the event is not in AppleEvent format }
- errAEEventNotHandled = -1708; { the AppleEvent was not handled by any handler }
- errAEReplyNotValid = -1709; { AEResetTimer was passed an invalid reply parameter }
- errAEUnknownSendMode = -1710; { mode wasn't NoReply, WaitReply, or QueueReply or Interaction level is unknown }
- errAEWaitCanceled = -1711; { in AESend, the user cancelled out of wait loop for reply or receipt }
- errAETimeout = -1712; { the AppleEvent timed out }
- errAENoUserInteraction = -1713; { no user interaction is allowed }
- errAENotASpecialFunction = -1714; { there is no special function for/with this keyword }
- errAEParamMissed = -1715; { a required parameter was not accessed }
- errAEUnknownAddressType = -1716; { the target address type is not known }
- errAEHandlerNotFound = -1717; { no handler in the dispatch tables fits the parameters to AEGetEventHandler or AEGetCoercionHandler }
- errAEReplyNotArrived = -1718; { the contents of the reply you are accessing have not arrived yet }
- errAEIllegalIndex = -1719; { index is out of range in a put operation }
- errAEUnknownObjectType = -1731; { available only in version 1.0.1 or greater }
- errAERecordingIsAlreadyOn = -1732; { available only in version 1.0.1 or greater }
-
- { Apple event descriptor types }
- typeBoolean = 'bool';
- typeChar = 'TEXT';
- typeSMInt = 'shor';
- typeInteger = 'long';
- typeSMFloat = 'sing';
- typeFloat = 'doub';
- typeLongInteger = 'long';
- typeShortInteger = 'shor';
- typeLongFloat = 'doub';
- typeShortFloat = 'sing';
- typeExtended = 'exte';
- typeComp = 'comp';
- typeMagnitude = 'magn';
- typeAEList = 'list';
- typeAERecord = 'reco';
- typeAppleEvent = 'aevt';
- typeTrue = 'true';
- typeFalse = 'fals';
- typeAlias = 'alis';
- typeEnumerated = 'enum';
- typeType = 'type';
- typeAppParameters = 'appa';
- typeProperty = 'prop';
- typeFSS = 'fss ';
- typeKeyword = 'keyw';
- typeSectionH = 'sect';
- typeWildCard = '****';
- typeApplSignature = 'sign';
- typeQDRectangle = 'qdrt';
- typeFixed = 'fixd';
- typeSessionID = 'ssid';
- typeTargetID = 'targ';
- typeProcessSerialNumber = 'psn ';
- typeNull = 'null'; { null or nonexistent data }
- { Keywords for Apple event parameters }
- keyDirectObject = '----';
- keyErrorNumber = 'errn';
- keyErrorString = 'errs';
- keyProcessSerialNumber = 'psn ';
- { Keywords for Apple event attributes }
- keyTransactionIDAttr = 'tran';
- keyReturnIDAttr = 'rtid';
- keyEventClassAttr = 'evcl';
- keyEventIDAttr = 'evid';
- keyAddressAttr = 'addr';
- keyOptionalKeywordAttr = 'optk';
- keyTimeoutAttr = 'timo';
- keyInteractLevelAttr = 'inte'; { this attribute is read only - will be set in AESend }
- keyEventSourceAttr = 'esrc'; { this attribute is read only }
- keyMissedKeywordAttr = 'miss'; { this attribute is read only }
- keyOriginalAddressAttr = 'from'; { new in 1.0.1 }
- { Keywords for special handlers }
- keyPreDispatch = 'phac'; { preHandler accessor call }
- keySelectProc = 'selh'; { more selector call }
- { Keyword for recording }
- keyAERecorderCount = 'recr'; { available only in vers 1.0.1 and greater }
- { Keyword for version information }
- keyAEVersion = 'vers'; { available only in vers 1.0.1 and greater }
- { Event Class }
- kCoreEventClass = 'aevt';
- { Event ID’s }
- kAEOpenApplication = 'oapp';
- kAEOpenDocuments = 'odoc';
- kAEPrintDocuments = 'pdoc';
- kAEQuitApplication = 'quit';
- kAEAnswer = 'ansr';
- kAEApplicationDied = 'obit';
-
- { Constants for use in AESend mode }
- kAENoReply = $00000001; { sender doesn't want a reply to event }
- kAEQueueReply = $00000002; { sender wants a reply but won't wait }
- kAEWaitReply = $00000003; { sender wants a reply and will wait }
- kAENeverInteract = $00000010; { server should not interact with user }
- kAECanInteract = $00000020; { server may try to interact with user }
- kAEAlwaysInteract = $00000030; { server should always interact with user where appropriate }
- kAECanSwitchLayer = $00000040; { interaction may switch layer }
- kAEDontReconnect = $00000080; { don't reconnect if there is a sessClosedErr from PPCToolbox }
- kAEWantReceipt = $00000200; { sender wants a receipt of message }
- kAEDontRecord = $00001000; { don't record this event - available only in vers 1.0.1 and greater }
- kAEDontExecute = $00002000; { don't send the event for recording - available only in vers 1.0.1 and greater }
- { Constants for the send priority in AESend }
- kAENormalPriority = $00000000; { post message at the end of the event queue }
- kAEHighPriority = $00000001; { post message at the front of the event queue }
-
- { Constants for recording }
- kAEStartRecording = 'reca'; { available only in vers 1.0.1 and greater }
- kAEStopRecording = 'recc'; { available only in vers 1.0.1 and greater }
- kAENotifyStartRecording = 'rec1'; { available only in vers 1.0.1 and greater }
- kAENotifyStopRecording = 'rec0'; { available only in vers 1.0.1 and greater }
- kAENotifyRecording = 'recr';
-
- { Constant for the returnID param of AECreateAppleEvent }
- kAutoGenerateReturnID = -1; { AECreateAppleEvent will generate a session-unique ID }
- { Constant for transaction ID’s }
- kAnyTransactionID = 0; { no transaction is in use }
- { Constants for timeout durations }
- kAEDefaultTimeout = -1; { timeout value determined by AEM }
- kNoTimeOut = -2; { wait until reply comes back, however long it takes }
-
- { Constants for AEResumeTheCurrentEvent }
- kAENoDispatch = 0; { dispatch parameter to AEResumeTheCurrentEvent takes a pointer to a dispatch }
- kAEUseStandardDispatch = $FFFFFFFF; { table, or one of these two constants }
- { Constants for Refcon in AEResumeTheCurrentEvent with kAEUseStandardDispatch }
- kAEDoNotIgnoreHandler = $00000000;
- kAEIgnoreAppPhacHandler = $00000001; { available only in vers 1.0.1 and greater }
- kAEIgnoreAppEventHandler = $00000002; { available only in vers 1.0.1 and greater }
- kAEIgnoreSysPhacHandler = $00000004; { available only in vers 1.0.1 and greater }
- kAEIgnoreSysEventHandler = $00000008; { available only in vers 1.0.1 and greater }
- kAEIngoreBuiltInEventHandler = $00000010; { available only in vers 1.0.1 and greater }
- kAEDontDisposeOnResume = $80000000; { available only in vers 1.0.1 and greater }
-
- { Apple event manager data types }
-
- type
- AEEventClass = FourCharCode;
-
- AEEventID = FourCharCode;
-
- AEKeyword = FourCharCode;
-
- DescType = ResType;
-
- AEDesc = record
- descriptorType: DescType;
- dataHandle: Handle;
- end;
- AEKeyDesc = record
- descKey: AEKeyword;
- descContent: AEDesc;
- end;
- { an AEDesc which contains address data }
- AEAddressDesc = AEDesc;
-
- { a list of AEDesc's is a special kind of AEDesc }
- AEDescList = AEDesc;
-
- { AERecord is a list of keyworded AEDesc's }
- AERecord = AEDescList;
-
- { an AERecord that contains an AppleEvent }
- AppleEvent = AERecord;
-
- { parameter to AESend }
- AESendMode = LONGINT;
-
- { priority param of AESend }
- AESendPriority = INTEGER;
-
-
- const
- kAEInteractWithSelf = 0;
- kAEInteractWithLocal = 1;
- kAEInteractWithAll = 2;
-
-
- type
- AEInteractAllowed = SInt8;
-
-
- const
- kAEUnknownSource = 0;
- kAEDirectCall = 1;
- kAESameProcess = 2;
- kAELocalProcess = 3;
- kAERemoteProcess = 4;
-
-
- type
- AEEventSource = SInt8;
-
-
- const
- kAEDataArray = 0;
- kAEPackedArray = 1;
- kAEHandleArray = 2;
- kAEDescArray = 3;
- kAEKeyDescArray = 4;
-
-
- type
- AEArrayType = SInt8;
-
- AEArrayData = record
- case INTEGER of
- 0: (
- kAEDataArray: array[0..0] of INTEGER;
- );
- 1: (
- kAEPackedArray: packed array[0..0] of CHAR;
- );
- 2: (
- kAEHandleArray: array[0..0] of Handle;
- );
- 3: (
- kAEDescArray: array[0..0] of AEDesc;
- );
- 4: (
- kAEKeyDescArray: array[0..0] of AEKeyDesc;
- );
- end;
- AEArrayDataPointer = ^AEArrayData;
-
- AEIdleProcPtr = ProcPtr; { FUNCTION AEIdle(VAR theEvent: EventRecord; VAR sleepTime: LONGINT; VAR mouseRgn: RgnHandle): BOOLEAN; }
- AEIdleUPP = UniversalProcPtr;
-
- const
- uppAEIdleProcInfo = $00000FD0; { FUNCTION (4 byte param, 4 byte param, 4 byte param): 1 byte result; }
-
- function NewAEIdleProc (userRoutine: AEIdleProcPtr): AEIdleUPP;
- inline
- $2E9F;
-
- function CallAEIdleProc (var theEvent: EventRecord;
- var sleepTime: LONGINT;
- var mouseRgn: RgnHandle;
- userRoutine: AEIdleUPP): BOOLEAN;
- inline
- $205F, $4E90;
- type
- AEFilterProcPtr = ProcPtr; { FUNCTION AEFilter(VAR theEvent: EventRecord; returnID: LONGINT; transactionID: LONGINT; (CONST)VAR sender: AEAddressDesc): BOOLEAN; }
- AEFilterUPP = UniversalProcPtr;
-
- const
- uppAEFilterProcInfo = $00003FD0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param): 1 byte result; }
-
- function NewAEFilterProc (userRoutine: AEFilterProcPtr): AEFilterUPP;
- inline
- $2E9F;
-
- function CallAEFilterProc (var theEvent: EventRecord;
- returnID: LONGINT;
- transactionID: LONGINT; {CONST}
- var sender: AEAddressDesc;
- userRoutine: AEFilterUPP): BOOLEAN;
- inline
- $205F, $4E90;
- type
- AEEventHandlerProcPtr = ProcPtr; { FUNCTION AEEventHandler((CONST)VAR theAppleEvent: AppleEvent; VAR reply: AppleEvent; handlerRefcon: LONGINT): OSErr; }
- AEEventHandlerUPP = UniversalProcPtr;
-
- const
- uppAEEventHandlerProcInfo = $00000FE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param): 2 byte result; }
-
- function NewAEEventHandlerProc (userRoutine: AEEventHandlerProcPtr): AEEventHandlerUPP;
- inline
- $2E9F;
-
- function CallAEEventHandlerProc ({CONST}
- var theAppleEvent: AppleEvent;
- var reply: AppleEvent;
- handlerRefcon: LONGINT;
- userRoutine: AEEventHandlerUPP): OSErr;
- inline
- $205F, $4E90;
- type
- AECoerceDescProcPtr = ProcPtr; { FUNCTION AECoerceDesc((CONST)VAR fromDesc: AEDesc; toType: DescType; handlerRefcon: LONGINT; VAR toDesc: AEDesc): OSErr; }
- AECoerceDescUPP = UniversalProcPtr;
-
- const
- uppAECoerceDescProcInfo = $00003FE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; }
-
- function NewAECoerceDescProc (userRoutine: AECoerceDescProcPtr): AECoerceDescUPP;
- inline
- $2E9F;
-
- function CallAECoerceDescProc ({CONST}
- var fromDesc: AEDesc;
- toType: DescType;
- handlerRefcon: LONGINT;
- var toDesc: AEDesc;
- userRoutine: AECoerceDescUPP): OSErr;
- inline
- $205F, $4E90;
- type
- AECoercePtrProcPtr = ProcPtr; { FUNCTION AECoercePtr(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size; toType: DescType; handlerRefcon: LONGINT; VAR result: AEDesc): OSErr; }
- AECoercePtrUPP = UniversalProcPtr;
-
- const
- uppAECoercePtrProcInfo = $0003FFE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; }
-
- function NewAECoercePtrProc (userRoutine: AECoercePtrProcPtr): AECoercePtrUPP;
- inline
- $2E9F;
-
- function CallAECoercePtrProc (typeCode: DescType;
- dataPtr: univ Ptr;
- dataSize: Size;
- toType: DescType;
- handlerRefcon: LONGINT;
- var result: AEDesc;
- userRoutine: AECoercePtrUPP): OSErr;
- inline
- $205F, $4E90;
-
- type
- AECoercionHandlerUPP = UniversalProcPtr;
-
- {*************************************************************************}
- { The following calls apply to any AEDesc. Every 'result' descriptor is}
- { created for you, so you will be responsible for memory management}
- { (including disposing) of the descriptors so created. Note: purgeable}
- { descriptor data is not supported - the AEM does not call LoadResource. }
- {*************************************************************************}
-
- function AECreateDesc (typeCode: DescType;
- dataPtr: univ Ptr;
- dataSize: Size;
- var result: AEDesc): OSErr;
- inline
- $303C, $0825, $A816;
- function AECoercePtr (typeCode: DescType;
- dataPtr: univ Ptr;
- dataSize: Size;
- toType: DescType;
- var result: AEDesc): OSErr;
- inline
- $303C, $0A02, $A816;
- function AECoerceDesc ({CONST}
- var theAEDesc: AEDesc;
- toType: DescType;
- var result: AEDesc): OSErr;
- inline
- $303C, $0603, $A816;
- function AEDisposeDesc (var theAEDesc: AEDesc): OSErr;
- inline
- $303C, $0204, $A816;
- function AEDuplicateDesc ({CONST}
- var theAEDesc: AEDesc;
- var result: AEDesc): OSErr;
- inline
- $303C, $0405, $A816;
- {*************************************************************************}
- { The following calls apply to AEDescList. Since AEDescList is a subtype of}
- { AEDesc, the calls in the previous section can also be used for AEDescList.}
- { All list and array indices are 1-based. If the data was greater than}
- { maximumSize in the routines below, then actualSize will be greater than}
- { maximumSize, but only maximumSize bytes will actually be retrieved.}
- {*************************************************************************}
- function AECreateList (factoringPtr: univ Ptr;
- factoredSize: Size;
- isRecord: BOOLEAN;
- var resultList: AEDescList): OSErr;
- inline
- $303C, $0706, $A816;
- function AECountItems ({CONST}
- var theAEDescList: AEDescList;
- var theCount: LONGINT): OSErr;
- inline
- $303C, $0407, $A816;
- function AEPutPtr (var theAEDescList: AEDescList;
- index: LONGINT;
- typeCode: DescType;
- dataPtr: univ Ptr;
- dataSize: Size): OSErr;
- inline
- $303C, $0A08, $A816;
- function AEPutDesc (var theAEDescList: AEDescList;
- index: LONGINT; {CONST}
- var theAEDesc: AEDesc): OSErr;
- inline
- $303C, $0609, $A816;
- function AEGetNthPtr ({CONST}
- var theAEDescList: AEDescList;
- index: LONGINT;
- desiredType: DescType;
- var theAEKeyword: AEKeyword;
- var typeCode: DescType;
- dataPtr: univ Ptr;
- maximumSize: Size;
- var actualSize: Size): OSErr;
- inline
- $303C, $100A, $A816;
- function AEGetNthDesc ({CONST}
- var theAEDescList: AEDescList;
- index: LONGINT;
- desiredType: DescType;
- var theAEKeyword: AEKeyword;
- var result: AEDesc): OSErr;
- inline
- $303C, $0A0B, $A816;
- function AESizeOfNthItem ({CONST}
- var theAEDescList: AEDescList;
- index: LONGINT;
- var typeCode: DescType;
- var dataSize: Size): OSErr;
- inline
- $303C, $082A, $A816;
- function AEGetArray ({CONST}
- var theAEDescList: AEDescList;
- arrayType: ByteParameter;
- arrayPtr: AEArrayDataPointer;
- maximumSize: Size;
- var itemType: DescType;
- var itemSize: Size;
- var itemCount: LONGINT): OSErr;
- inline
- $303C, $0D0C, $A816;
- function AEPutArray (var theAEDescList: AEDescList;
- arrayType: ByteParameter; {CONST}
- var arrayPtr: AEArrayData;
- itemType: DescType;
- itemSize: Size;
- itemCount: LONGINT): OSErr;
- inline
- $303C, $0B0D, $A816;
- function AEDeleteItem (var theAEDescList: AEDescList;
- index: LONGINT): OSErr;
- inline
- $303C, $040E, $A816;
- {*************************************************************************}
- { The following calls apply to AERecord. Since AERecord is a subtype of}
- { AEDescList, the calls in the previous sections can also be used for}
- { AERecord an AERecord can be created by using AECreateList with isRecord}
- { set to true. }
- {*************************************************************************}
- function AEPutKeyPtr (var theAppleEvent: AppleEvent;
- theAEKeyword: AEKeyword;
- typeCode: DescType;
- dataPtr: univ Ptr;
- dataSize: Size): OSErr;
- inline
- $303C, $0A0F, $A816;
- function AEPutKeyDesc (var theAppleEvent: AppleEvent;
- theAEKeyword: AEKeyword; {CONST}
- var theAEDesc: AEDesc): OSErr;
- inline
- $303C, $0610, $A816;
- function AEGetKeyPtr ({CONST}
- var theAppleEvent: AppleEvent;
- theAEKeyword: AEKeyword;
- desiredType: DescType;
- var typeCode: DescType;
- dataPtr: univ Ptr;
- maximumSize: Size;
- var actualSize: Size): OSErr;
- inline
- $303C, $0E11, $A816;
- function AEGetKeyDesc ({CONST}
- var theAppleEvent: AppleEvent;
- theAEKeyword: AEKeyword;
- desiredType: DescType;
- var result: AEDesc): OSErr;
- inline
- $303C, $0812, $A816;
- function AESizeOfKeyDesc ({CONST}
- var theAppleEvent: AppleEvent;
- theAEKeyword: AEKeyword;
- var typeCode: DescType;
- var dataSize: Size): OSErr;
- inline
- $303C, $0829, $A816;
- function AEDeleteKeyDesc (var theAppleEvent: AppleEvent;
- theAEKeyword: AEKeyword): OSErr;
- inline
- $303C, $0413, $A816;
- function AEPutParamPtr (var theAppleEvent: AppleEvent;
- theAEKeyword: AEKeyword;
- typeCode: DescType;
- dataPtr: univ Ptr;
- dataSize: Size): OSErr;
- inline
- $303C, $0A0F, $A816;
- function AEPutParamDesc (var theAppleEvent: AppleEvent;
- theAEKeyword: AEKeyword; {CONST}
- var theAEDesc: AEDesc): OSErr;
- inline
- $303C, $0610, $A816;
- function AEGetParamPtr ({CONST}
- var theAppleEvent: AppleEvent;
- theAEKeyword: AEKeyword;
- desiredType: DescType;
- var typeCode: DescType;
- dataPtr: univ Ptr;
- maximumSize: Size;
- var actualSize: Size): OSErr;
- inline
- $303C, $0E11, $A816;
- function AEGetParamDesc ({CONST}
- var theAppleEvent: AppleEvent;
- theAEKeyword: AEKeyword;
- desiredType: DescType;
- var result: AEDesc): OSErr;
- inline
- $303C, $0812, $A816;
- function AESizeOfParam ({CONST}
- var theAppleEvent: AppleEvent;
- theAEKeyword: AEKeyword;
- var typeCode: DescType;
- var dataSize: Size): OSErr;
- inline
- $303C, $0829, $A816;
- function AEDeleteParam (var theAppleEvent: AppleEvent;
- theAEKeyword: AEKeyword): OSErr;
- inline
- $303C, $0413, $A816;
- {*************************************************************************}
- { The following calls also apply to type AppleEvent. Message attributes are}
- { far more restricted, and can only be accessed through the following 5}
- { calls. The various list and record routines cannot be used to access the}
- { attributes of an event. }
- {*************************************************************************}
- function AEGetAttributePtr ({CONST}
- var theAppleEvent: AppleEvent;
- theAEKeyword: AEKeyword;
- desiredType: DescType;
- var typeCode: DescType;
- dataPtr: univ Ptr;
- maximumSize: Size;
- var actualSize: Size): OSErr;
- inline
- $303C, $0E15, $A816;
- function AEGetAttributeDesc ({CONST}
- var theAppleEvent: AppleEvent;
- theAEKeyword: AEKeyword;
- desiredType: DescType;
- var result: AEDesc): OSErr;
- inline
- $303C, $0826, $A816;
- function AESizeOfAttribute ({CONST}
- var theAppleEvent: AppleEvent;
- theAEKeyword: AEKeyword;
- var typeCode: DescType;
- var dataSize: Size): OSErr;
- inline
- $303C, $0828, $A816;
- function AEPutAttributePtr (var theAppleEvent: AppleEvent;
- theAEKeyword: AEKeyword;
- typeCode: DescType;
- dataPtr: univ Ptr;
- dataSize: Size): OSErr;
- inline
- $303C, $0A16, $A816;
- function AEPutAttributeDesc (var theAppleEvent: AppleEvent;
- theAEKeyword: AEKeyword; {CONST}
- var theAEDesc: AEDesc): OSErr;
- inline
- $303C, $0627, $A816;
- {*************************************************************************}
- { The next couple of calls are basic routines used to create, send,}
- { and process AppleEvents. }
- {*************************************************************************}
- function AECreateAppleEvent (theAEEventClass: AEEventClass;
- theAEEventID: AEEventID; {CONST}
- var target: AEAddressDesc;
- returnID: INTEGER;
- transactionID: LONGINT;
- var result: AppleEvent): OSErr;
- inline
- $303C, $0B14, $A816;
- function AESend ({CONST}
- var theAppleEvent: AppleEvent;
- var reply: AppleEvent;
- sendMode: AESendMode;
- sendPriority: AESendPriority;
- timeOutInTicks: LONGINT;
- idleProc: AEIdleUPP;
- filterProc: AEFilterUPP): OSErr;
- inline
- $303C, $0D17, $A816;
- function AEProcessAppleEvent ({CONST}
- var theEventRecord: EventRecord): OSErr;
- inline
- $303C, $021B, $A816;
- { }
- { Note: during event processing, an event handler may realize that it is likely}
- { to exceed the client's timeout limit. Passing the reply to this}
- { routine causes a wait event to be generated that asks the client}
- { for more time. }
- {}
- function AEResetTimer ({CONST}
- var reply: AppleEvent): OSErr;
- inline
- $303C, $0219, $A816;
- {*************************************************************************}
- { The following four calls are available for applications which need more}
- { sophisticated control over when and how events are processed. Applications}
- { which implement multi-session servers or which implement their own}
- { internal event queueing will probably be the major clients of these}
- { routines. They can be called from within a handler to prevent the AEM from}
- { disposing of the AppleEvent when the handler returns. They can be used to}
- { asynchronously process the event (as MacApp does).}
- {*************************************************************************}
- function AESuspendTheCurrentEvent ({CONST}
- var theAppleEvent: AppleEvent): OSErr;
- inline
- $303C, $022B, $A816;
- { }
- { Note: The following routine tells the AppleEvent manager that processing}
- { is either about to resume or has been completed on a previously suspended}
- { event. The procPtr passed in as the dispatcher parameter will be called to}
- { attempt to redispatch the event. Several constants for the dispatcher}
- { parameter allow special behavior. They are:}
- { - kAEUseStandardDispatch means redispatch as if the event was just}
- { received, using the standard AppleEvent dispatch mechanism.}
- { - kAENoDispatch means ignore the parameter.}
- { Use this in the case where the event has been handled and no}
- { redispatch is needed.}
- { - non nil means call the routine which the dispatcher points to.}
- {}
- function AEResumeTheCurrentEvent ({CONST}
- var theAppleEvent: AppleEvent; {CONST}
- var reply: AppleEvent;
- dispatcher: AEEventHandlerUPP;
- handlerRefcon: LONGINT): OSErr;
- inline
- $303C, $0818, $A816;
- function AEGetTheCurrentEvent (var theAppleEvent: AppleEvent): OSErr;
- inline
- $303C, $021A, $A816;
- function AESetTheCurrentEvent ({CONST}
- var theAppleEvent: AppleEvent): OSErr;
- inline
- $303C, $022C, $A816;
- {*************************************************************************}
- { The following three calls are used to allow applications to behave}
- { courteously when a user interaction such as a dialog box is needed. }
- {*************************************************************************}
- function AEGetInteractionAllowed (var level: AEInteractAllowed): OSErr;
- inline
- $303C, $021D, $A816;
- function AESetInteractionAllowed (level: ByteParameter): OSErr;
- inline
- $303C, $011E, $A816;
- function AEInteractWithUser (timeOutInTicks: LONGINT;
- nmReqPtr: NMRecPtr;
- idleProc: AEIdleUPP): OSErr;
- inline
- $303C, $061C, $A816;
- {*************************************************************************}
- { These calls are used to set up and modify the event dispatch table.}
- {*************************************************************************}
- function AEInstallEventHandler (theAEEventClass: AEEventClass;
- theAEEventID: AEEventID;
- handler: AEEventHandlerUPP;
- handlerRefcon: LONGINT;
- isSysHandler: BOOLEAN): OSErr;
- inline
- $303C, $091F, $A816;
- function AERemoveEventHandler (theAEEventClass: AEEventClass;
- theAEEventID: AEEventID;
- handler: AEEventHandlerUPP;
- isSysHandler: BOOLEAN): OSErr;
- inline
- $303C, $0720, $A816;
- function AEGetEventHandler (theAEEventClass: AEEventClass;
- theAEEventID: AEEventID;
- var handler: AEEventHandlerUPP;
- var handlerRefcon: LONGINT;
- isSysHandler: BOOLEAN): OSErr;
- inline
- $303C, $0921, $A816;
- {*************************************************************************}
- { These calls are used to set up and modify the coercion dispatch table.}
- {*************************************************************************}
- function AEInstallCoercionHandler (fromType: DescType;
- toType: DescType;
- handler: AECoercionHandlerUPP;
- handlerRefcon: LONGINT;
- fromTypeIsDesc: BOOLEAN;
- isSysHandler: BOOLEAN): OSErr;
- inline
- $303C, $0A22, $A816;
- function AERemoveCoercionHandler (fromType: DescType;
- toType: DescType;
- handler: AECoercionHandlerUPP;
- isSysHandler: BOOLEAN): OSErr;
- inline
- $303C, $0723, $A816;
- function AEGetCoercionHandler (fromType: DescType;
- toType: DescType;
- var handler: AECoercionHandlerUPP;
- var handlerRefcon: LONGINT;
- var fromTypeIsDesc: BOOLEAN;
- isSysHandler: BOOLEAN): OSErr;
- inline
- $303C, $0B24, $A816;
- {*************************************************************************}
- { These calls are used to set up and modify special hooks into the}
- { AppleEvent manager.}
- {*************************************************************************}
- function AEInstallSpecialHandler (functionClass: AEKeyword;
- handler: UniversalProcPtr;
- isSysHandler: BOOLEAN): OSErr;
- inline
- $303C, $0500, $A816;
- function AERemoveSpecialHandler (functionClass: AEKeyword;
- handler: UniversalProcPtr;
- isSysHandler: BOOLEAN): OSErr;
- inline
- $303C, $0501, $A816;
- function AEGetSpecialHandler (functionClass: AEKeyword;
- var handler: UniversalProcPtr;
- isSysHandler: BOOLEAN): OSErr;
- inline
- $303C, $052D, $A816;
- {*************************************************************************}
- { This call was added in version 1.0.1. If called with the keyword}
- { keyAERecorderCount ('recr'), the number of recorders that are}
- { currently active is returned in 'result'.}
- {*************************************************************************}
- { available only in vers 1.0.1 and greater }
- function AEManagerInfo (keyWord: AEKeyword;
- var result: LONGINT): OSErr;
- inline
- $303C, $0441, $A816;
-
- implementation
- end.